/**
 * 
 */
package org.sishoras.modelo;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 * This class is part of the SisHoras project	
 * Creation:  27/12/2008 20:31:20
 * TODO
 * 
 * @author Walker Rabelo
 * 
 */
@Entity
public class OcorrenciaDisciplina {

	@Id @GeneratedValue
	private int id;
	@ManyToOne
	private Disciplina disciplina;
	@ManyToOne
	private Professor professor;
	@ManyToMany(
	        targetEntity=Horario.class,
	        cascade={CascadeType.PERSIST, CascadeType.MERGE}
	    )
    @JoinTable(
        name="OCORDISC_HORARIO",
        joinColumns = @JoinColumn(name="OCOR_ID"), 
        inverseJoinColumns=@JoinColumn(name="HORAR_ID")
    )
	private Set<Horario> horarios;
	
	@OneToMany (mappedBy = "ocorrenciaDisciplina")
	private Set<Aula> aulas;	
	
	/**
	 * 
	 */
	public OcorrenciaDisciplina() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the disciplina
	 */
	public Disciplina getDisciplina() {
		return disciplina;
	}

	/**
	 * @param disciplina the disciplina to set
	 */
	public void setDisciplina(Disciplina disciplina) {
		this.disciplina = disciplina;
	}

	/**
	 * @return the professor
	 */
	public Professor getProfessor() {
		return professor;
	}

	/**
	 * @param professor the professor to set
	 */
	public void setProfessor(Professor professor) {
		this.professor = professor;
	}

	/**
	 * @return the aulas
	 */
	public Set<Aula> getAulas() {
		return aulas;
	}

	/**
	 * @param aulas the aulas to set
	 */
	public void setAulas(Set<Aula> aulas) {
		this.aulas = aulas;
	}

	/**
	 * @return the horarios
	 */
	public Set<Horario> getHorarios() {
		return horarios;
	}

	/**
	 * @param horarios the horarios to set
	 */
	public void setHorarios(Set<Horario> horarios) {
		this.horarios = horarios;
	}

}
